home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / dev / amos / AMOSL0495.lzh / AMOSLIST / 000111_amos-request@svcs1.digex.net_Mon Apr 24 09:32:34 1995.msg < prev    next >
Internet Message Format  |  1995-05-01  |  4KB

  1. Received: from svcs1.digex.net by nfs2.digex.net with SMTP id AA13450
  2.   (5.67b8/IDA-1.5); Mon, 24 Apr 1995 09:32:32 -0400
  3. Received: by svcs1.digex.net id AA29682
  4.   (5.67b8/IDA-1.5 for amos-out); Mon, 24 Apr 1995 03:52:29 -0400
  5. Received: from nfs2.digex.net by svcs1.digex.net with SMTP id AA29675
  6.   (5.67b8/IDA-1.5 for <amos@svcs1.digex.net>); Mon, 24 Apr 1995 03:52:25 -0400
  7. Received: from eros.Britain.EU.net by nfs2.digex.net with SMTP id AA18384
  8.   (5.67b8/IDA-1.5 for <amos-list@access.digex.net>); Mon, 24 Apr 1995 03:52:22 -0400
  9. Received: from eurotherm.co.uk by eros.britain.eu.net with UUCP 
  10.           id <sg.10784-0@eros.britain.eu.net>; Mon, 24 Apr 1995 08:52:06 +0100
  11. Received: from keeper.controls.eurotherm.co.uk by m17.controls.eurotherm.co.uk;
  12.           Mon, 24 Apr 95 07:32:19 GMT
  13. Received: from osprey.controls.eurotherm.co.uk by keeper.eurotherm.co.uk;
  14.           Mon, 24 Apr 95 07:31:02 GMT
  15. Message-Id: <11870.9504240732@m17.controls.eurotherm.co.uk>
  16. Received: from dab.controls.eurotherm.co.uk by m17.controls.eurotherm.co.uk;
  17.           Mon, 24 Apr 95 07:32:15 GMT
  18. Sender: paulhi <paulhi@ecl.etherm.co.uk>
  19. From: Paul Hickman <paul.hickman@ecl.etherm.co.uk>
  20. Organization: Eurotherm Controls Limited
  21. To: amos-list@access.digex.net
  22. Date: Mon, 24 Apr 1995 08:33:11 0
  23. Subject: Re: If vs On Proc
  24. Reply-To: paul.hickman@ecl.etherm.co.uk
  25. Priority: normal
  26. X-Mailer: Pegasus Mail/Windows (v1.22)
  27. Status: O
  28. X-Status: 
  29.  
  30.  
  31. > From:          Tolga Turkoglu <e92_tot@elixir.e.kth.se>
  32. > Date:          Sat, 22 Apr 1995 18:33:09 +0200
  33. > To:            amos-list@access.digex.net
  34. > Subject:       If vs On Proc
  35.  
  36. > Hello everybody,
  37. > I was wondering about which of these three routines 
  38. > that are faster:
  39. > 1)
  40. >     ...
  41. >     MK=Mouse Key
  42. >     MC=Mouse Click
  43. >     If MC<>0
  44. >       If MC=2
  45. >         If MK=3
  46. >           ...
  47. >         Else
  48. >           ...
  49. >         End If
  50. >       Else
  51. >         If MK=3
  52. >           ...
  53. >         Else
  54. >           ...
  55. >         End If
  56. >     Else
  57. >       If MK=1
  58. >         ...
  59. >       Else
  60. >         ...
  61. >       End If
  62. >     End If
  63. >     ...
  64. > 2)
  65. >     ...
  66. >     MK=Mouse Key
  67. >     MC=Mouse Click
  68. >     If MC=2 and MK=3 then ...
  69. >     If MC=2 and MK<>3 then ...
  70. >     If MC=1 and MK=3 then ...
  71. >     If MC=1 and MK<>3 then ...
  72. >     ...
  73. > 3)
  74. >     ...
  75. >     MICE=Mouse Click
  76. >     Rol.b 2,MICE
  77. >     Add MICE,Mouse Key
  78. >     On MICE Proc ZIP,ZIP,ZIP,ZIP,MICE_5,ZIP,MICE_7,...
  79. >     ...
  80. > All three has both good and bad sides,but
  81. > which one is faster?
  82. Haven't the foggiest, but they will all be so fast that it will make 
  83. little difference - go for the 1st or 2nd one in preference to the 
  84. third, as it will probably be slower.
  85.  
  86. > I've heard that procedures should be avoided to make
  87. > routines faster.Is it true always or is it true only on
  88. > events like when a procedure is returning or receiving an
  89. > argument? 
  90. Procedures are slower, but it is only worth avoiding them if you 
  91. really need the speed increase. In normal programing where speed is 
  92. not of the essence, use them. I usually use goto when using On Error 
  93. inside a procedure, and hardly ever use gosub. 
  94.  
  95. The loss of local variables just doesn't make Gosub worthwhile, and 
  96. it is less strict with syntax checking (You can do horrible things 
  97. like jump into the middle of a loop). Some people will jump down my 
  98. throat screamming "How dare you not use the fastest hackiest solution 
  99. available - call yourself an amiga programmer?", but all I can say is 
  100. if speed of execution is that important to you, buy an accelerator, 
  101. or learn C++.
  102. --------------------------------------------------------
  103.  WORK: Eurotherm Controls, Worthing                     
  104.  Email: paul.hickman@controls.eurotherm.co.uk           
  105.                                                         
  106.  UNIVERSITY: Imperial College, London                      
  107.  Email: ph@doc.ic.ac.uk                                 
  108. --------------------------------------------------------